package com.niodata.dp.monitor.sharelib.entity.file;

public enum AlarmType {
  NotArriveInTime("文件未及时到达", "监控信息"),
  MissingFile("文件缺失", "文件缺失列表"),
  AbnormalFileCount("文件数量异常", "监控信息"),
  AbnormalFileSize("文件大小异常", "异常文件信息"),
  AbnormalFileName("文件名异常", "异常文件信息");

  private String msg;
  private String title;

  private AlarmType(String msg, String title) {
    this.msg = msg;
    this.title = title;
  }

  public static AlarmType fromString(String msg) {
    for (AlarmType alarmType : AlarmType.values()) {
      if (alarmType.getMsg().equalsIgnoreCase(msg)) {
        return alarmType;
      }
    }
    return null;
  }

  public String getMsg() {
    return msg;
  }

  public String getTitle() {
    return title;
  }
}
